/*    */ package com.qmsk.business.store.perfectGoods.controller;
/*    */ 
/*    */ import com.qmsk.business.store.perfectGoods.dao.PerfectGoodsDAO;
/*    */ import com.utils.gson.out.GsonEbRst;
/*    */ import com.utils.web.RequestUtils;
/*    */ import com.utils.web.ResponseUtils;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.apache.log4j.Logger;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.web.bind.annotation.PathVariable;
/*    */ import org.springframework.web.bind.annotation.RequestMapping;
/*    */ 
/*    */ @Controller
/*    */ @RequestMapping({"/perfectgoods"})
/*    */ public class PerfectGoodsController
/*    */ {
/* 26 */   private static Logger logger = Logger.getLogger(PerfectGoodsController.class);
/*    */ 
/*    */   @Autowired
/*    */   private PerfectGoodsDAO dao;
/*    */ 
/*    */   @RequestMapping(value={"/info/{goodsId}"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*    */   public void list(HttpServletRequest request, HttpServletResponse response, @PathVariable("goodsId") Long goodsId)
/*    */   {
/*    */     try {
/* 35 */       GsonEbRst rst = this.dao.getgoodsInfo(goodsId);
/* 36 */       ResponseUtils.setResponseResult(rst, response);
/*    */     } catch (Exception e) {
/* 38 */       e.printStackTrace();
/* 39 */       logger.error(e);
/* 40 */       logger.error(RequestUtils.getFindDataErrorMessage(request));
/* 41 */       ResponseUtils.setErrorMsgResponse("服务器忙，请稍后再试！", response);
/*    */     }
/*    */   }
/*    */ 
/*    */   @RequestMapping(value={"/list/{type}/{page}/{size}"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*    */   public void list(HttpServletRequest request, HttpServletResponse response, @PathVariable("type") Short type, @PathVariable("page") Integer page, @PathVariable("size") Short size)
/*    */   {
/* 49 */     size = RequestUtils.getRequestValidPageSize(size);
/*    */     try
/*    */     {
/* 52 */       Map params = new HashMap();
/* 53 */       params.put("type", type);
/* 54 */       GsonEbRst rst = this.dao.getPerfectGoodslist(params, page, size);
/* 55 */       ResponseUtils.setResponseResult(rst, response);
/*    */     } catch (Exception e) {
/* 57 */       e.printStackTrace();
/* 58 */       logger.error(e);
/* 59 */       logger.error(RequestUtils.getFindDataErrorMessage(request));
/* 60 */       ResponseUtils.setErrorMsgResponse("服务器忙，请稍后再试！", response);
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.store.perfectGoods.controller.PerfectGoodsController
 * JD-Core Version:    0.5.3
 */